import { lazy } from 'react';

export default [
	/**
	 * 管理员路由
	 */
	{
		path: '/todo-kenel',
		label: '待办中心',
		roles: ['ADMIN'],
		component: lazy(() => import('../view/admin/backlog')),
	},
	{
		path: '/todo-details',
		roles: ['ADMIN'],
		hidden: true,
		component: lazy(() => import('../view/admin/todo-details')),
	},
	{
		path: '/audit',
		roles: ['ADMIN'],
		hidden: true,
		component: lazy(() => import('../view/admin/audit/index')),
	},
	{
		path: '/parking-record/check',
		roles: ['ADMIN'],
		hidden: true,
		component: lazy(() => import('../view/user/parking-record/my-record/check')),
	},
	{
		path: '/parking-record-management',
		label: '停车场备案管理',
		roles: ['ADMIN'],
		component: lazy(() => import('../view/admin/parking-record-management')),
	},
	{
		path: '/parking-management',
		label: '停车场管理',
		roles: ['ADMIN'],
		component: lazy(() => import('../view/admin/parking-management')),
	},
	{
		path: '/parking-query',
		label: '停车场查询',
		roles: ['ADMIN'],
		component: lazy(() => import('../view/admin/parking-query')),
	},
	{
		path: '/person',
		label: '个人中心',
		roles: ['ADMIN'],
		component: lazy(() => import('../view/admin/person')),
	},
	/**
	 * 系统管理员路由
	 */
	{
		path: '/parking-record',
		label: '停车单位管理',
		roles: ['SYSTEM_ADMIN'],
		component: lazy(() => import('../view/system-admin/parking-unit')),
	},
	{
		path: '/parking-manage',
		label: '停车用户管理',
		roles: ['SYSTEM_ADMIN'],
		component: lazy(() => import('../view/system-admin/parking-user')),
	},
	/**
	 * 经营者路由
	 */
	{
		path: '/home',
		label: '首页',
		roles: ['USER'],
		component: lazy(() => import('../view/user/home')),
	},
	{
		path: '/parking-record',
		label: '停车备案管理',
		roles: ['USER'],
		children: [
			{
				path: '/parking-record/add',
				label: '新增备案',
				roles: ['USER'],
				component: lazy(() => import('../view/user/parking-record/add')),
			},
			{
				path: '/parking-record/my-record',
				label: '我的备案',
				roles: ['USER'],
				component: lazy(() => import('../view/user/parking-record/my-record')),
			},
			{
				path: '/parking-record/update',
				roles: ['USER'],
				hidden: true,
				component: lazy(() => import('../view/user/parking-record/my-record/update')),
			},
			{
				path: '/parking-record/editor',
				roles: ['USER'],
				hidden: true,
				component: lazy(() => import('../view/user/parking-record/my-record/editor')),
			},
			{
				path: '/parking-record/check',
				roles: ['USER'],
				hidden: true,
				component: lazy(() => import('../view/user/parking-record/my-record/check')),
			},
		],
	},
	{
		path: '/parking-lot',
		label: '停车场管理',
		roles: ['USER'],
		component: lazy(() => import('../view/user/parking-lot')),
	},
	{
		path: '/personal',
		label: '个人中心',
		roles: ['USER'],
		component: lazy(() => import('../view/user/person')),
	},
	{ path: '/error/404', roles: ['ADMIN'], hidden: true, component: lazy(() => import('../components/error/404')) },
	{ path: '*', hidden: true, roles: ['ADMIN'], component: lazy(() => import('../components/error/404')) },
	{
		path: '/error/404',
		roles: ['SYSTEM_ADMIN'],
		hidden: true,
		component: lazy(() => import('../components/error/404')),
	},
	{ path: '*', hidden: true, roles: ['SYSTEM_ADMIN'], component: lazy(() => import('../components/error/404')) },
	{ path: '/error/404', roles: ['USER'], hidden: true, component: lazy(() => import('../components/error/404')) },
	{ path: '*', hidden: true, roles: ['USER'], component: lazy(() => import('../components/error/404')) },
];
